package top.ffhome.concurrency.example.singleton;

import top.ffhome.common.annotation.ThreadSafe;

/**
 * 懒汉模式
 */
@ThreadSafe
public class SingletonExample3 {
    private SingletonExample3() {
    }

    private static SingletonExample3 instance = null;

    public static synchronized SingletonExample3 getInstance() {
        if (instance == null) {
            instance = new SingletonExample3();
        }
        return instance;
    }
}
